package com.cn.file;

/**
 * 存储等待刷盘到consume的数据
 */
public class DispatchRequest {

    //消息主题
    private String topic;

    //队列id
    private int queueId;

    //消息在commitlog文件中的位置
    private long commitLogOffset;

    //消息大小
    private int msgSize;
    //存储时间
    private long storeTimestamp;
    //消息在quque队列中是第几个（在向commit保存的时候就已经计算好了）
    private long consumeQueueOffset;

    public DispatchRequest(String topic, int queueId, long commitLogOffset, int msgSize, long storeTimestamp, long consumeQueueOffset) {
        this.topic = topic;
        this.queueId = queueId;
        this.commitLogOffset = commitLogOffset;
        this.msgSize = msgSize;
        this.storeTimestamp = storeTimestamp;
        this.consumeQueueOffset = consumeQueueOffset;
    }

    public String getTopic() {
        return topic;
    }

    public int getQueueId() {
        return queueId;
    }

    public long getCommitLogOffset() {
        return commitLogOffset;
    }

    public int getMsgSize() {
        return msgSize;
    }

    public long getStoreTimestamp() {
        return storeTimestamp;
    }

    public long getConsumeQueueOffset() {
        return consumeQueueOffset;
    }
}
